#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>


int main()
{
    int fout = open("bite.txt",O_WRONLY | O_TRUNC | O_CREAT,0666);
    int lst = fout;
    printf("%d\n",lst);
    dup2(fout,1);
    printf("%d\n",fout);
    char input[] = {"i like linux!"};
    write(fout,input,strlen(input)+1);
    write(lst,input,strlen(input)+1);
    return 0;
}
